package com.xuyuan.socket.mycase1;

import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;

public class StrategyWebSocketHandler extends BaseWebSocketHandler {

    private final MessageHandler messageHandler;

    public StrategyWebSocketHandler(MessageHandler messageHandler) {
        this.messageHandler = messageHandler;
    }

    @Override
    protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
        messageHandler.handleMessage(session, message);
    }
}
